#
# Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES, ALL RIGHTS RESERVED.
#
# This software product is a proprietary product of NVIDIA CORPORATION &
# AFFILIATES (the "Company") and all right, title, and interest in and to the
# software product, including all associated intellectual property rights, are
# and shall remain exclusively with the Company.
#
# This software product is governed by the End User License Agreement
# provided with the software product.
#



app_dependencies += dependency('doca-argp')
app_dependencies += dependency('doca-flow')
app_dependencies += dependency('doca-common')

app_srcs = [
	'lthread.c',
	'lthread_sched.c', 
	'lthread_cond.c',
	'lthread_tls.c', 
	'lthread_mutex.c',
	'lthread_diag.c',
	'ctx.c',
	'fasthash.c',
	common_dir_path + '/dpdk_utils.c',
	common_dir_path + '/offload_rules.c',
	common_dir_path + '/utils.c',
]





executable(DOCA_PREFIX + APP_NAME + '3',
	app_srcs + ['./sketch_case_2/sketch_case2_es' + '.c'],
	dependencies : app_dependencies,
	include_directories : app_inc_dirs,
	install: install_apps)


executable(DOCA_PREFIX + APP_NAME + '4',
	app_srcs + ['./sketch_case_2/sketch_case2_es4' + '.c'],
	dependencies : app_dependencies,
	include_directories : app_inc_dirs,
	install: install_apps)


executable(DOCA_PREFIX + APP_NAME + '5',
	app_srcs + ['./sketch_case_2/sketch_case2_es5' + '.c'],
	dependencies : app_dependencies,
	include_directories : app_inc_dirs,
	install: install_apps)



executable(DOCA_PREFIX + APP_NAME + '6',
	app_srcs + ['./sketch_case_2/sketch_case2_es6' + '.c'],
	dependencies : app_dependencies,
	include_directories : app_inc_dirs,
	install: install_apps)



executable(DOCA_PREFIX + APP_NAME + '7',
	app_srcs + ['./sketch_case_2/sketch_case2_es7' + '.c'],
	dependencies : app_dependencies,
	include_directories : app_inc_dirs,
	install: install_apps)



executable(DOCA_PREFIX + APP_NAME + '8',
	app_srcs + ['./sketch_case_2/sketch_case2_es8' + '.c'],
	dependencies : app_dependencies,
	include_directories : app_inc_dirs,
	install: install_apps)



executable(DOCA_PREFIX + APP_NAME + '9',
	app_srcs + ['./sketch_case_2/sketch_case2_es9' + '.c'],
	dependencies : app_dependencies,
	include_directories : app_inc_dirs,
	install: install_apps)



executable(DOCA_PREFIX + APP_NAME + '10',
	app_srcs + ['./sketch_case_2/sketch_case2_es10' + '.c'],
	dependencies : app_dependencies,
	include_directories : app_inc_dirs,
	install: install_apps)


# dirs = ['./cm', './cs','./cbf','./es','./fr','./nitro','./um']
dirs = ['cm', 'cs','cbf','es','fr','nitro','um', 'case2_cm']
foreach dir : dirs
    my_files = run_command('python3', 'get_files.py', dir)
    my_files = my_files.stdout().strip().split('\n')
    foreach file : my_files
  	executable (file, 
  	app_srcs + ['./'+ dir + '/' + file + '.c'],
  	dependencies : app_dependencies,
  	include_directories : app_inc_dirs,
  	install: install_apps)
   endforeach
endforeach

# executable('sketch_skv_1',
# 	app_srcs + ['./skv/sketch_skv_1' + '.c'],
# 	dependencies : app_dependencies,
# 	include_directories : app_inc_dirs,
# 	install: install_apps)

# executable('sketch_skv_2',
# 	app_srcs + ['./skv/sketch_skv_2' + '.c'],
# 	dependencies : app_dependencies,
# 	include_directories : app_inc_dirs,
# 	install: install_apps)

# # executable('sketch_skv_3',
# # 	app_srcs + ['./skv/sketch_skv_3' + '.c'],
# # 	dependencies : app_dependencies,
# # 	include_directories : app_inc_dirs,
# # 	install: install_apps)

# # executable('sketch_skv_4',
# # 	app_srcs + ['./skv/sketch_skv_4' + '.c'],
# # 	dependencies : app_dependencies,
# # 	include_directories : app_inc_dirs,
# # 	install: install_apps)

# # executable('sketch_skv_5',
# # 	app_srcs + ['./skv/sketch_skv_5' + '.c'],
# # 	dependencies : app_dependencies,
# # 	include_directories : app_inc_dirs,
# # 	install: install_apps)

